package org.example.app.xact;

import com.logicfishsoftware.owlet.app.Application;
import com.logicfishsoftware.owlet.app.ApplicationException;
import com.logicfishsoftware.owlet.app.Operator;
import com.logicfishsoftware.owlet.app.runtime.RuntimeApplication;
import com.logicfishsoftware.owlet.app.runtime.TransactionalRuntime;

/**
 * Hello world!
 *
 */
public class ExampleTransactionalApp
extends TransactionalRuntime<ExampleTransactionalApp.ExampleAtom,ExampleTransactionalApp.ExampleContext>
implements Application<ExampleTransactionalApp.ExampleOperator>
{
	class ExampleContext 
	extends TransactionalRuntime<ExampleAtom, ExampleContext>.TransactionalContext 
	{

		/* (non-Javadoc)
		 * @see com.logicfishsoftware.owlet.app.runtime.TransactionalRuntime.TransactionalContext#commit(com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationAtom)
		 */
		@Override
		public void commit(ExampleAtom atom) throws ApplicationException {
			// TODO Auto-generated method stub
		}

		/* (non-Javadoc)
		 * @see com.logicfishsoftware.owlet.app.runtime.TransactionalRuntime.TransactionalContext#rollback(com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationAtom)
		 */
		@Override
		public void rollback(ExampleAtom atom) throws ApplicationException {
			// TODO Auto-generated method stub

		}

		/* (non-Javadoc)
		 * @see com.logicfishsoftware.owlet.app.runtime.TransactionalRuntime.TransactionalContext#dispose()
		 */
		@Override
		public void dispose() throws ApplicationException {
			// TODO Auto-generated method stub

		}		
	}
	class ExampleAtom 
	extends RuntimeApplication<ExampleAtom, ExampleContext>.ApplicationAtom {

		/* (non-Javadoc)
		 * @see com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationAtom#application(com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationContext)
		 */
		@Override
		public boolean application(ExampleContext context) throws Exception {
			// TODO Auto-generated method stub
			return false;
		}

		/* (non-Javadoc)
		 * @see com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationAtom#proceed()
		 */
		@Override
		public ExampleAtom proceed() throws ApplicationException {
			// TODO Auto-generated method stub
			return null;
		}

	}
	public interface ExampleOperator 
	extends Operator<ExampleContext> {

	}
	/* (non-Javadoc)
	 * @see com.logicfishsoftware.owlet.app.ApplicationRuntime#createFrame(com.logicfishsoftware.owlet.app.ApplicationRuntime.ApplicationAtom)
	 */
	@Override
	protected ExampleContext createAppContext(ExampleAtom atomic) {
		// TODO Auto-generated method stub
		return null;
	}
	/* (non-Javadoc)
	 * @see com.logicfishsoftware.owlet.app.Application#apply(java.lang.Object)
	 */
	public boolean enter(ExampleOperator atomic) throws ApplicationException {
		return false;
	}
	public static void main( String[] args )
	{
		System.out.println( "Hello World!" );
	}
	/* (non-Javadoc)
	 * @see com.logicfishsoftware.owlet.app.runtime.RuntimeApplication#createAtom(com.logicfishsoftware.owlet.app.Operator)
	 */
	@Override
	protected ExampleAtom createAtom(Operator<? super ExampleContext> proceed)
			throws ApplicationException {
		// TODO Auto-generated method stub
		return null;
	}
}
